﻿// ***********************************************************************
// Assembly         : INNOVACALL.Framework.Common
// Author           : LJO+01 (Laurent Jordi)
// Created          : 06-05-2013
// Last Modified By : LJO+01 (Laurent Jordi)
// Last Modified On : 06-05-2013
// ***********************************************************************
// <copyright file="_LayoutTools.cs" company="Copyright © Innovacall 2011">
//     Copyright (c) Copyright © Innovacall 2011. All rights reserved.
// </copyright>
// <summary></summary>
// ***********************************************************************
using System.IO;
using System.Web;

namespace INNOVACALL.Framework.Common.MVCHelpers
{
	/// <summary>
	/// Class _LayoutTools
	/// </summary>
	public static class _LayoutTools
	{
		/// <summary>
		/// Reads the file JS stream.
		/// </summary>
		/// <param name="UrlSpecificJqueryJSFile">The URL specific jquery JS file.</param>
		/// <returns>System.String.</returns>
		public static string ReadFileJSStream(string UrlSpecificJqueryJSFile)
		{
			string ligne = null;
			string pathfile = HttpContext.Current.Server.MapPath(UrlSpecificJqueryJSFile);
			if (System.IO.File.Exists(pathfile))
			{
				var sr = new StreamReader(pathfile);
				ligne = sr.ReadToEnd();
				sr.Close();
			}
			else
			{
				ligne = "// ["+UrlSpecificJqueryJSFile+"] not found";
			}
			return ligne;
		}
	}
}
